    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>360开机隐藏</title>
        <style>
            *{
                margin: 0;
                padding: 0;
            }
            #box{
                width: 322px;
                position: absolute;
                bottom: 0;
                right: 0;
            }
            #box #span{
                position: absolute;
                top: 0;
                right: 0;
                width: 20px;
                height: 20px;
                /*background: crimson;*/
                cursor: pointer;
            }
        </style>
    </head>
    <body>
    <div id="box">
        <span id="span"></span>
        <div id="img1">
            <img src="img/上.jpg" alt="">
        </div>
        <div id="img2">
            <img src="img/下.jpg" alt="">
        </div>
    </div>

    <script>
        var box=document.getElementById('box');
        var imgArr=box.children;
        var b=document.getElementById('img2');
        var span=document.getElementById('span');
        console.log(b);
        span.onclick=function () {
         animo(b,{"height":0},function () {
                animo(box,{"width":0})
         });
        };

        function animo(ele,json,fn) {
            clearInterval(ele.timer);

            ele.timer=setInterval(function () {
                var bool=true;
                for (var k in json){
                    var present=parseInt(getStyle(ele,k))||0;
                    var space=(json[k]-present)/10;
                    space=space>0?Math.ceil(space):Math.floor(space);

                    present=present+space;

                    ele.style[k]=present+"px";

                    if (json[k]!==present){
                        bool=false;
                    }
                }
                console.log("看到此消息证明还么有清楚计时器");
                if(bool){
                    clearInterval(ele.timer);
                    if (fn){
                        fn();
                    }
                }
            },15)
        }
        function getStyle(ele,zhi) {
            if (window.getComputedStyle(ele)){
                return window.getComputedStyle(ele,null)[zhi];
            }
            return  ele.currentStyle[zhi];
        }
    </script>
    </body>
    </html>